<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core_rt'%>
<%@ taglib uri="http://www.springframework.org/spring-social/facebook/tags" prefix="facebook" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Update Status</title>

<!-- jQuery required for Facebook connect form -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>

</head>
<script type="text/javascript">
function submitForm(){
	
	alert("Submitting");
	document.forms[0].submit();
}
</script>
<body>
<h1>Update Status</h1>
<a href="<c:url value='/j_spring_security_logout'/>">Logout</a>

<h2>Services</h2>

<!--  LINKEDIN -->

<c:if test="${connectedToLinkedIn}">
    Connected to LinkedIn as <a href="<c:out value='${linkedInProfile.publicProfileUrl }'/>"><c:out value="${linkedInProfile.firstName }"/> <c:out value="${linkedInProfile.lastName }"/></a><br/>
</c:if>
<c:if test="${!connectedToLinkedIn}">
    <a href="<c:url value='/connect/linkedin'/>">Connect to LinkedIn</a>
</c:if>




<!--  FACEBOOK -->

<c:if test="${connectedToFacebook}">
    Connected to Facebook as <c:out value="${facebookProfile.firstName }"/> <c:out value="${facebookProfile.lastName }"/>
</c:if>
<c:if test="${!connectedToFacebook}">

<%/* Connect to Facebook */ %> 

<form id="fb_signin" action="fbAuthAction" name="fbAuthAction"  method="post">
    <div class="formInfo">
    </div>
    <div id="fb-root"></div>	
    <p><fb:login-button perms="email,publish_stream,offline_access" onclick="submitForm()" v="2" length="long">Connect to Facebook</fb:login-button></p>
</form>
<facebook:init appId=""/>
</c:if>

<br/>

<!--  TWITTER -->

<c:if test="${connectedToTwitter}">
    Connected to Twitter as <c:out value="${twitterProfile}"/><br/>
</c:if>
<c:if test="${!connectedToTwitter}">
    <a href="<c:url value='/connect/twitter'/>">Connect to Twitter</a>
</c:if>


<!-- UPDATE STATUS -->
<form action="facebookAction" method="post">
   <h4>Status Page</h4>
</form>

</body>
</html>